package net.my.msn.web.forms;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 *class, which is responsible for the validation of web-form data.
 */
public class Registration {

	@Size(min = 3, max = 20, message = "Username must be between 3 and 20 characters long.")
	@Pattern(regexp = "^[a-zA-Z0-9]+$", message = "Username must be alphanumeric with no spaces")
	private String username;

	@Size(min = 6, max = 20, message = "The password must be at least 6 characters long.")
	private String password;

	@Size(min = 6, max = 20, message = "The confirmation must be at least 6 characters long")
	private String confirm;

	@Size(min = 3, max = 20, message = "Your firstname must be between 3 and 50 characters long.")
	private String firstname;

	@Size(min = 3, max = 20, message = "Your lastname must be between 3 and 50 characters long.")
	private String lastname;

	@Pattern(regexp = "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}", message = "Invalid email address.")
	private String email;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getConfirm() {
		return confirm;
	}

	public void setConfirm(String confirm) {
		this.confirm = confirm;
	}

}
